package RenameBean;

import MethodAnnotations.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author quan
 * @Description TODO
 * @Date 2023/7/13 9:06
 */
public class Main {
    public static void main(String[] args) {
//        //对Bean对象重命名测试
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        User user = (User) context.getBean("aaa"); //获取到小花花
////        AddParams.User user = (AddParams.User) context.getBean("aaa");//获取到小星星
//        User user = (User) context.getBean("bbb");//获取到小星星
        System.out.println(user.getName());


        //对五大注解重命名
//        ApplicationContext context1 = new ClassPathXmlApplicationContext("spring-config.xml");
//        a02_RenameConfig config = (a02_RenameConfig) context1.getBean("config_hello");
//        config.sayHello();
    }
}
